package com.dy.lock.screen.service.impl;

import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.UUID;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.dy.lock.screen.dao.CustomerBlacklistDao;
import com.dy.lock.screen.pojo.CustomerBlacklistInfo;
import com.dy.lock.screen.service.CustomerBlacklistService;

@Service("customerBlacklistService")
public class CustomerBlacklistServiceImpl implements CustomerBlacklistService {

	@Resource(name = "customerBlacklistDao")
	private CustomerBlacklistDao customerBlacklistDao;

	@Override
	public CustomerBlacklistInfo queryByPrimaryKey(String id) {
		return this.customerBlacklistDao.queryByPrimaryKey(id);

	}

	@Override
	public int delete(CustomerBlacklistInfo blacklistInfo) {
		// TODO Auto-generated method stub
		return this.customerBlacklistDao.delete(blacklistInfo);
	}

	@Override
	public CustomerBlacklistInfo queryByBlackIdAndBeBlackId(
			CustomerBlacklistInfo blacklistInfo) {
		// TODO Auto-generated method stub
		return this.customerBlacklistDao
				.queryByBlackIdAndBeBlackId(blacklistInfo);
	}

	@Override
	public Integer queryCount(Map<String, Object> para) {
		// TODO Auto-generated method stub
		return this.customerBlacklistDao.queryCount(para);
	}

	@Override
	public List<CustomerBlacklistInfo> queryPage(Map<String, Object> para) {
		// TODO Auto-generated method stub
		return this.customerBlacklistDao.queryT(para);
	}

	@Override
	public int save(CustomerBlacklistInfo blacklistInfo) {
		blacklistInfo.setId(UUID.randomUUID().toString());
		blacklistInfo.setBlackTime(new Date());
		return this.customerBlacklistDao.insert(blacklistInfo);
	}

}
